import request from '@/utils/request'



// 查询机房列表
export function listRoom(query) {
  return request({
    url: '/biz/room/list',
    method: 'get',
    params: query
  })
}

// 查询机房详细
export function getRoom(id) {
  return request({
    url: '/biz/room/' + id,
    method: 'get'
  })
}

// 新增机房
export function addRoom(data) {
  return request({
    url: '/biz/room',
    method: 'post',
    data: data
  })
}

// 修改机房
export function updateRoom(data) {
  return request({
    url: '/biz/room',
    method: 'put',
    data: data
  })
}

// 删除机房
export function delRoom(id) {
  return request({
    url: '/biz/room/' + id,
    method: 'delete'
  })
}

// 导出机房
export function exportRoom(query) {
  return request({
    url: '/biz/room/export',
    method: 'get',
    params: query
  })
}

// 查询所有机房信息
export function selectRoomList(siteId) {
  return request({
    url: '/biz/room/selectRoomList',
    method: 'post',
    data: {
    	siteId: siteId
    }
  })
}
// 查询对应机房信息
export function changeRoomList(id) {
  return request({
    url: '/biz/room/changeRoomList/'+id,
    method: 'get'
  })
}

//机构-站点-机房 树结构
export function treeselect(query) {
  return request({
    url: '/biz/room/treeSelect',
    method: 'get',
    params: query
  })
}
